<?php

namespace seecms\lib\module;

abstract class ModuleConfig
{

    /**
     * 版本
     * @var string
     */
    protected $version = 'v1.0.0';

    /**
     * 类型
     * extension=扩展插件(商品/用户/微信公众号等),
     * widget=小工具/挂件(侧边栏小工具/页脚/页头组件内容区块插件)
     * @var string
     */
    protected $type = 'extension';

    /**
     * 模块名称
     * @var string
     */
    protected $name = '';

    /**
     * 模块描述
     * @var string
     */
    protected $description = '';

    /**
     * 分类
     * category=0|'' 未分类
     * category=1(功能扩展)
     * category=2(企业应用)
     * category=3(行业应用)
     * @var string
     */
    protected $category = '';

    /**
     * 作者
     * @var string
     */
    protected $auth = '';

    /**
     * 价格
     * @var string
     */
    protected $price = '0';

    /**
     * 主页
     * @var string
     */
    protected $home = '';

    abstract public function controller(): array;

    abstract public function lang(): string;

    abstract public function view(): string;

    public function publish(): ?ModulePublish
    {
        return null;
    }

    public function config(): array
    {
        return [
            'name' => $this->name,
            'description' => $this->description,
            'type' => $this->type,
            'version' => $this->version,
            'category' => $this->category,
            'auth' => $this->auth,
            'price' => $this->price,
            'home' => $this->home,
        ];
    }
}